class Test:
    count = 0

    def setNum(self, x, y):
        self.x = x
        self.y = y

    def getNum(self):
        print('x= %d y= %d' % (self.x, self.y))


a = Test()
b = Test()
b.count += 10
# 每个对象的之间互不干扰
print(a.count)  # 0
print(b.count)  # 10

# 使用类对象更改属性
Test.count += 20
# 对象b之前的值 将类对象的值给覆盖了
print(a.count)  # 20
print(b.count)  # 10

c = Test()
# __dict__是用来存储对象属性的一个字典，其键为属性名，值为属性的值。
# 此时为空
print(c.__dict__)  # {}
print(Test.__dict__)

c.setNum(1, 2)
c.getNum()  # x= 1 y= 2
print(c.__dict__)  # {'x': 1, 'y': 2}
